# 全量字段断言工具

import jsonschema


def jsonschena_qlzd(resp, status_code, success, code, message, data):
    assert status_code == resp.status_code
    schema = {
        "type": "object",
        "required": ["success", "code", "message", "data"],
        "properties": {
            "success": {"const": success},
            "code": {"const": code},
            "message": {"pattern": message},
            "data": {"type": data, }
        }
    }
    jsonschema.validate(resp.json(), schema)
